<template>
	<div class="page">
		<c-title :hide="false" text="商品详情"></c-title>
		<div class="image">
			<img :src="img" alt="">
		</div>
		<div class="js">
			{{data.goods_desc}}
		</div>
		<div class="bottom" @click="lxkf">
			联系客服
		</div>
	</div>
</template>

<script>
	export default{
		data(){
			return{
				id:'',
				data:{},
				img:''
			}
		},
		activated() {
			this.id = this.$route.query.id
			console.log(this.$route.query)
			this.getdata()
		},
		methods:{
			lxkf(){
				window.location = 'https://mdk.zaixianvip.net/web/im?cptid=6acd9ecb44b4'
			},
			getdata(){
			$http
				.post("plugin.hft-yh.api.index.goods_detail", {
					id:this.id
				})
				.then(response => {
					console.log(response)
					if (response.result === 1) {
						this.data=response.data
						this.img =JSON.parse(response.data.goods_pic)[0]
					} else {
						Toast(response.msg);
					}
				})
				.catch(error => {
					console.log(error);
				});	
			},
		}
	}
</script>

<style scoped lang="scss">
	.page{
		.bottom{
			position:fixed;
			bottom: 0;
			width: 100%;
			line-height:2rem;
			background-color:#CB2D01;
			color: #fff;
		}
		.js{
			width: 100%;
			background-color: #fff;
			line-height: 2rem;
			padding: 1rem;
			text-align: left;
		}
		.image{
			height: 15rem;
			img{
				height: 100%;
				width: 100%;
			}
		}
	}
</style>